// TreeManager.h: interface for the CTreeManager class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_TREEMANAGER_H__32F18335_45DB_4F17_A777_61DA178E2436__INCLUDED_)
#define AFX_TREEMANAGER_H__32F18335_45DB_4F17_A777_61DA178E2436__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

typedef void (*lpTraverseCallback)(DWORD, DWORD, LPVOID);

class CTreeNode;

class CTreeManager  
{
public:
	CTreeManager();
	~CTreeManager();

	BOOL CreateTree(CString, lpTraverseCallback pCallbackFun = NULL, LPVOID lParam = NULL);
	void CleanTree();
	BOOL IsTraversing();
	//
	UINT GetTreeLevel();
	void GetTreeSize(LARGE_INTEGER&);
	//
	void FindNode();
	void AddNode();
	void DelNode();
	
	void UpdateNode();

private:
	CTreeNode* m_pRootNode;
	//add "*" for rootpath, like "c:\" to "c:\*"
	CString RemoveBackSlash(CString&);
	CString GetFullPath(CTreeNode*);
	BOOL IsDot(CString);
	void CountChild(CTreeNode*);

	UINT m_nPercent;
	
	BOOL m_bTraversing;
};

#endif // !defined(AFX_TREEMANAGER_H__32F18335_45DB_4F17_A777_61DA178E2436__INCLUDED_)
